Skip to main content

Get Bucket Policy

AutomatR.AWS.Activities.GetBucketPolicy

The "Get Bucket Policy" activity in AutomatR is part of the AWS S3 (Simple Storage Service) activities package, enabling automation processes to retrieve the policy associated with a specific bucket. This activity streamlines the process of obtaining the bucket policy, enhancing the efficiency of automation workflows.

Properties

NameDescription
Input
Access Key IDProvides the encrypted access key ID for your AWS account, enabling connection to the AWS S3 service. String variables containing the access key ID.
Secret Access KeyProvides the encrypted secret access key for your AWS account, enabling connection to the AWS S3 service. String variables containing the secret access key.
RegionSpecifies the Amazon S3 region where the bucket policy should be retrieved. Use the RegionEndpoint enumeration to set the region.
Bucket NameSpecifies the name of the bucket for which the policy should be retrieved. String variables containing the bucket name.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Get Bucket Policy" activity. Useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the wait time is 1000 milliseconds or 1 sec, i.e., 1.
Output
ResultOutputs the result of the "Get Bucket Policy" operation, indicating whether the policy retrieval was successful (true) or encountered errors (false). Variables of relevant types (e.g., Boolean variables) to store the operation result.

How to use:

  1. Drag and drop the "Get Bucket Policy" activity onto the workflow.
  2. Configure the properties by providing the required inputs, such as access key ID, secret access key, region, and bucket name.
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to retrieve the policy associated with the specified bucket.

Example: Consider an example where the "Get Bucket Policy" activity is used to check if a policy exists for a bucket named "example-bucket" in the "us-west-2" region:

Get Bucket Policy:
Display Name: "Check Bucket Policy"
Access Key ID: "**************"
Secret Access Key: "**************"
Region: "us-west-2"
Bucket Name: "example-bucket"
Result: hasBucketPolicy

In this example, the activity checks if a policy exists for the "example-bucket" in the "us-west-2" region. The result of the operation (true or false) is stored in the Boolean variable "hasBucketPolicy" for further handling in the workflow.